FileSystem

Exit
  • :q

    • quits if no change is made

    • This fails when changes have been made and Vim refuses to abandon the current buffer, and when the last file in the argument list has not been edited.

    • If there are other tab pages and quitting the last window in the current tab page, the current tab page is closed.

    • Triggers the |QuitPre| autocommand event.

    • :q!   ||   ZQ

      • Force quit, discarding changes.

Save
  • :w

    • write changes, saving the file.

    • if the file doesn't exist, a name can be given.

    • :w Test

      • saves the file as Test

    • :w!

      • Like ":write", but forcefully writes when 'readonly' is set or there is another reason writing was refused.

      • Note: This may change permissions and ownership of the file and break (symbolic) links.  Add the 'W' flag to 'cpoptions' to avoid this.

  • :x  ||  ZZ

    • write changes and quit.

    • :wq

      • Doesn't work if the file is readonly.

    • :wq!

      • Force to write the file and quit after saving.

Create
  • :e

    • ~creates a file or edits an existing one.

      • I interpret as touch

    • Pathing is always based on the terminal cd , usually in $HOME .

Delete
  • :!del

    • deletes a file

    • It's an external command.

    • :!del Test

      • deletes the file Test

Info
  • :f

    • name of the current file

    • :f new_name.lua

      • rename the file to the given name.

    • edits the given file

      • :fin file_name.lua

      • :e file_name.lua

  • :!dir

    • list your directory

    • It's an external command.

  • :ls  ||  :files

    • list files

NetRW
  • Tutorial .

  • :Ex  |  :Explore

    • goes back to NetRW if inside a file